package com.icsss.test1.controller;

import com.icsss.test1.pojo.Person;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
public class StoreController {

    @Autowired
    RestTemplate restTemplate;

    @GetMapping("/client1/getobj")
    public Object client12(){

        String url = "http://test2/client1/getObj";

        Class<Person> responseType = Person.class;

        Person ajaxResult = restTemplate.getForObject(url, responseType);


//        Person p = restTemplate.getForObject(url, Person.class);
        return ajaxResult;
    }
}